<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    const arr = [1,2,3];
    console.log(arr);
    /*下面两行是等价的*/
    console.log(...arr);
    console.log(1, 2, 3);

    function f1(x,y,z) {
        console.log(x);
        console.log(y);
        console.log(z);
    }
    f1(1,2,3);
    f1(...arr)

    console.log(Math.max(1, 2, 3));
    console.log(Math.max(...arr));


    const arr2 = [1,3,5,7,9];
    const arr3 = arr2;
    console.log(arr2);
    console.log(arr3);
    arr3.push(11);
    console.log(arr3);
    console.log(arr2);
    /*使用展开运算符进行复制，可以解决数组内容联动的问题*/
    const  arr4 = [...arr2];
    console.log(arr4);
    arr4.push(100);
    console.log(arr2);
    console.log(arr4);
    /*使用展开运算符进行数组合并*/
    const arr5 = [...arr2,...arr3];
    console.log(arr5);


</script>
</html>